﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESOL.Common;

namespace ESOL.WinUI.BaseForm
{
    public partial class frmBaseDialogyMaintainForm : frmBaseDialogyForm
    {
        public ActionType ThisActionType { get; set; }

        public frmBaseDialogyMaintainForm()
        {
            InitializeComponent();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            Click_Save();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Click_Cancel();
        }

        protected virtual void Click_Save()
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        protected virtual void Click_Cancel()
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        protected override void OnShown(EventArgs e)
        {
            if (ThisActionType == ActionType.View)
            {
                btnSave.Visible = false;
                btnCancel.Text = "关闭";
                btnCancel.Image = Properties.Resources.OK;
                UICommon.UICommonFunctions.SetControlsEnable(this.Controls, false);
            }
            base.OnShown(e);
        }
    }
}
